package com.example.hello;

import com.example.hello.client.TextArea.BootstrapTextAreaState;
import com.vaadin.event.FieldEvents;
import com.vaadin.ui.AbstractComponent;

public class BootstrapTextArea extends AbstractComponent implements FieldEvents.TextChangeNotifier {

    public enum Alignment {
        CENTER, JUSTIFY, LEFT, RIGHT
    }

    public enum ResizeType {
        BOTH, HORIZONTAL, INHERIT, NONE, VERTICAL
    }

    @Override
    protected BootstrapTextAreaState getState() {
        return (BootstrapTextAreaState) super.getState();
    }

    public Alignment getAlignment() {
        return Alignment.valueOf(getState().getAlignment());
    }

    public void setAlignment(Alignment alignment) {
        getState().setAlignment(alignment.toString());
    }

    public int getCharacterWidth() {
        return getState().getCharacterWidth();
    }

    public void setCharacterWidth(int characterWidth) {
        getState().setCharacterWidth(characterWidth);
    }

    public int getCursorPos() {
        return getState().getCursorPos();
    }

    public void setCursorPos(int cursorPos) {
        getState().setCursorPos(cursorPos);
    }

    public String getPlaceholder() {
        return getState().getPlaceholder();
    }

    public void setPlaceholder(String placeholder) {
        getState().setPlaceholder(placeholder);
    }

    public ResizeType getResize() {
        return ResizeType.valueOf(getState().getResize());
    }

    public void setResize(ResizeType resize) {
        getState().setResize(resize.toString());
    }

    public int getVisibleLines() {
        return getState().getVisibleLines();
    }

    public void setVisibleLines(int visibleLines) {
        getState().setVisibleLines(visibleLines);
    }

    @Override
    public void addTextChangeListener(FieldEvents.TextChangeListener listener) {

    }

    @Override
    public void addListener(FieldEvents.TextChangeListener listener) {

    }

    @Override
    public void removeTextChangeListener(FieldEvents.TextChangeListener listener) {

    }

    @Override
    public void removeListener(FieldEvents.TextChangeListener listener) {

    }

}
